package MidAutumnFestival;

import java.util.Scanner;

//5)、编写Java程序，输入3个整数，并求出3个整数的最大值和最小值。
public class Test5 {
    public static void main(String[] args) {
        int a, b, c, max, min;
        System.out.println("输入三个整数：");
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        max = a;
        if (b > a && b > c) {
            max = b;
        }
        if (c > a && c > b) {
            max = c;
        }
        min = a;
        if (b < a && b < c) {
            min = b;
        }
        if (c < a && c < b) {
            min = c;
        }
        System.out.println("最大值：" + max + "最小值：" + min);
    }
}

